package com.societyGames.flashForms
{
import flash.geom.Rectangle;

public class CropContainer extends SingleItemContainer
{
  protected var _desiredWidth:Number;
  protected var _desiredHeight:Number;
  private var _scrollRect:Rectangle = new Rectangle();

  public function CropContainer()
  {
  }

  override public function set width(value:Number):void
  {
    this._desiredWidth = value;
    recalculate();
  }

  override public function set height(value:Number):void
  {
    this._desiredHeight = value;
    recalculate();
  }

  protected function recalculate():void
  {
    this._scrollRect.width = this._desiredWidth;
    this._scrollRect.height = this._desiredHeight;
    this.scrollRect = this._scrollRect;
  }
}
}